<?php
class User extends CI_Controller {
    
    // 构造函数
    public function __construct()
    {
        parent::__construct();
        $this->load->helper(array('form', 'url'));
    }

    // index方法是默认方法
    public function index()
    {
        // $this->load->helper('url');
        // echo site_url('news/local/123');
        // echo base_url();
        $this->load->view('signin/index.html');
    }

    // 登录
    public function check()
    {
        var_dump($_POST);
    }

    // 显示注册页面
    public function regview()
    {
        // $this->load->helper('url');
        // $this->load->helper(array('form', 'url'));

        

        // echo site_url('news/local/123');
        // echo base_url();
        $this->load->view('signin/reg.html');
    }
    // 注册用户
    public function reg()
    {
        // $this->load->helper(array('form', 'url'));
        $this->load->library('form_validation');
        // echo '我将进行数据检测，并插入到数据库';
        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('signin/reg.html');
        }
        else
        {
            $this->load->view('signin/index.html');
        }
    }
    // 注销
}